﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ValidationEngine.Commons;

namespace ValidationEngineXTest.Models
{
    class Product: ValidateableModel
    {
        private long _id = GetNewId();
        private string _name = string.Empty;

        public long Id
        {
            get { return _id; }
            set
            {
                if (_id != value)
                {
                    _id = value;
                    OnChanged("Id");
                }
            }
        }

        public string Name
        {
            get { return _name; }
            set
            {
                if (null != _name && !_name.Equals(value))
                {
                    _name = value;
                    OnChanged("Name");
                }
            }
        }
    }
}
